<template>
  <div class="home">
  <!-- 1、导航头图片 -->
    <div class="banner">
    <img src="../assets/KZODY~AXJKA3{JECAO3C7FO.png"  alt="">
    <div id="covSize">新冠疫情实时动态</div>
  </div>
<!-- 2、病毒信息展示 -->
    <CovInfo :covInof='covInfo' :news='news'/>
<!-- 3、导航 -->
<ul class="list">
 <li class="item">
  <router-link to="/area">

      <svg t="1658108509422" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5255" width="64" height="64"><path d="M495.5 264.2c172 0 253.4 71.1 253.4 71.1V149S623.4 98.2 498.4 98.2c-129.6 0-257.7 50.8-257.7 50.8v203.3l20-19.9s61.7-68.2 234.8-68.2zM444 166h33.9v-33.9h33.9V166h33.9v33.9h-33.9v33.9h-33.9v-33.9H444V166z m-82.5 479.3c-150 24.9-256.4 97.1-256.4 229.2 2 34.3 22.3 53.5 60 53.4 87.2-0.2 184.2 0.4 329.7 0.4v-51.9c-47.5-20.6-94.3-231.9-133.3-231.1z m366.9-158.7c15.6-5.5 35.5-18 42.7-51.7 9.2-42.7-23.8-52.9-23.8-52.9-2.8-0.1-5.8 2.1-8.8 5.8-5.3-13-15.2-25.6-25.6-33.7-59.5-46.1-117.6-48.6-201.2-48.3-92.3 0.3-169.1 16.2-210.7 49.3-11 8.8-20 19.2-25 31-2.4-2.7-4.9-4.2-7.2-4.1 0 0-32.6 10.3-23.5 53.1 6.9 32.7 25.5 45.6 40.7 51.3 33 89.6 109.8 147.2 211.5 147.2 101.6 0 197.9-57.5 230.9-147z m-66.7 158.7c-39-0.8-85.5 210.4-133 231v51.9c145.5 0 242.2-0.6 329.4-0.4 37.7 0.1 58-21.7 60-56.1 0-132-106.4-201.5-256.4-226.4z" p-id="5256" fill="#ea9518"></path></svg>
      <div>风险地区</div>

  </router-link>
 </li>
  <li class="item">
    <router-link to="/hesuan">
      <svg t="1658108657549" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6255" width="64" height="64"><path d="M1020 0H34.7c-9.6 0-18.2 3.9-24.5 10.1C3.9 16.4 0 25.1 0 34.7c0 15.6 11.2 29 26.5 31.5C102.3 78.8 160 144.7 160 224v672c0 70.7 57.3 128 128 128h576c70.7 0 128-57.3 128-128V68c0-2.2 1.8-4 4-4h24c2.2 0 4-1.8 4-4V4c0-2.2-1.8-4-4-4zM832 892c0 2.2-1.8 4-4 4H580c-2.2 0-4-1.8-4-4v-56c0-2.2 1.8-4 4-4h248c2.2 0 4 1.8 4 4v56z m0-128c0 2.2-1.8 4-4 4H580c-2.2 0-4-1.8-4-4v-56c0-2.2 1.8-4 4-4h248c2.2 0 4 1.8 4 4v56z m0-128c0 2.2-1.8 4-4 4H580c-2.2 0-4-1.8-4-4v-56c0-2.2 1.8-4 4-4h248c2.2 0 4 1.8 4 4v56z m0-128c0 2.2-1.8 4-4 4H580c-2.2 0-4-1.8-4-4v-56c0-2.2 1.8-4 4-4h248c2.2 0 4 1.8 4 4v56z m0-128c0 2.2-1.8 4-4 4H580c-2.2 0-4-1.8-4-4v-56c0-2.2 1.8-4 4-4h248c2.2 0 4 1.8 4 4v56z m0-128c0 2.2-1.8 4-4 4H580c-2.2 0-4-1.8-4-4v-56c0-2.2 1.8-4 4-4h248c2.2 0 4 1.8 4 4v56z" p-id="6256" fill="#07fa53"></path></svg>
      <div>核酸检测</div>
    </router-link>

  </li>
  <li class="item">
    <router-link to="/Prevention">
      <svg t="1658108807760" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8530" width="64" height="64"><path d="M905.7 216.3c0-30.2-1.2-60-3.7-89.3-0.7-8.5-6.8-15.7-15.1-17.8C770.4 80 644 64 512 64s-258.4 16-375 45.3c-8.3 2.1-14.4 9.2-15.1 17.8-2.4 29.3-3.7 59.1-3.7 89.3 0 344.9 161.3 637.6 385.3 741.8 5.3 2.5 11.5 2.5 16.9 0 224-104.2 385.3-397 385.3-741.9z" p-id="8531" fill="#594d9c"></path></svg>
      <div>防疫物资</div>
    </router-link>
  </li>
  <li class="item">
    <router-link to="/travel">
      <svg t="1658108902485" class="icon" viewBox="0 0 1262 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10996" width="64" height="64"><path d="M1136.047385 339.881769c-23.341731-196.733067-118.702365-340.157424-235.779091-339.881372L358.68492 1.288641C241.577522 1.564693 146.922354 145.357118 124.408779 342.243548c-82.2635 48.953223-124.683492 148.73069-124.40744 264.151103 0.184035 85.698813 24.016525 162.53329 69.902504 216.394105l0.460087 191.365389 212.805429-0.490759-0.276052-112.077117 697.338055-1.686985 0.276052 112.077117 212.805429-0.521432-0.460087-191.365389c45.640599-54.014177 69.135693-131.002016 68.920986-216.700829C1261.528361 488.183045 1218.586937 388.497596 1136.047385 339.881769zM358.930299 74.319734 900.513674 73.031491c75.392872-0.184035 141.491992 101.985882 166.490036 240.563992-11.53284-2.300433-23.648456-3.711366-36.193486-4.447505 0-0.306724 0.337397-0.920173 0.061345-0.889501-101.893865 0.24538-70.055866 0.153362-141.798717 0.337397s-46.560773 0.092017-118.119589 0.276052L247.282597 310.129497c-19.016916 0.030672-36.99097 2.085726-53.983505 5.551713C217.806376 176.919065 283.537427 74.473096 358.930299 74.319734zM218.297135 702.031337c-46.591445 0.092017-84.318553-42.788062-84.441243-95.974083-0.12269-53.094004 37.420384-96.250135 83.981157-96.372825 46.376738-0.092017 84.103846 42.880079 84.257209 95.974083C302.216947 658.93655 264.704546 701.908647 218.297135 702.031337zM875.270251 683.903921l-488.366682 0.582776c-76.12901 0.184035-77.785322-131.124706-0.306724-131.30874l488.366682-1.165553C946.184946 551.82837 946.49167 683.719887 875.270251 683.903921zM1043.938031 700.037628c-46.468755 0.12269-84.195864-42.757389-84.318553-95.94341-0.12269-53.094004 37.420384-96.280807 83.858467-96.372825 46.499428-0.12269 84.257209 42.849407 84.379898 95.974083C1127.888515 656.973514 1090.406786 699.976283 1043.938031 700.037628z" p-id="10997" fill="#1196db"></path></svg>
      <div>出行政策</div>
    </router-link>
  </li>
</ul>

<!-- 全国数据统计 -->
    <CovNum :covNum='covNum'/>
<br>

<!-- 国内疫情 -->
    <ChildMap/>
<!-- 世界疫情 -->
<br>
    <worldMap/>
    <br>
    <footer id="foot">
    </footer>
  </div>
</template>

<script>
import {getCovInfo} from '@/api/index.js'
import CovInfo from './Home/covInfo.vue'
import CovNum from './covNum/covNum.vue'
import ChildMap from './ECharts/ChildMap.vue'
import worldMap from '@/view/ECharts/worldMap'
export default {
    name: "Home",
    components: { CovInfo, CovNum, ChildMap, ChildMap,worldMap},
    data() {
      return {
        covInfo:{},
        news:[],
        covNum:{},//全国数据统计
      };
    },
    methods: {
    getCovData(){
      getCovInfo().then(res=>{
        // console.log(res);
        let data = res.newslist[0].desc;
        // 传递疫情信息
        this.covInfo = {
          midDangerCount: data.midDangerCount,
          highDangerCount:data.highDangerCount
        }
        // console.log(this.covInfo);

        // 传递疫情热点
        this.news = res.newslist[0].news;


      //  全国数据统计
      this.covNum = {
        // 相比昨日确诊人数
          currentConfirmedIncr:data.currentConfirmedIncr,
        // 现存确诊
          currentConfirmedCount:data.currentConfirmedCount,
        // 累计死亡人数
          deadCount:data.deadCount,
        // 新增死亡人数
          deadIncr: data.deadIncr,
        // 治愈人数
          curedCount:data.curedCount,
        //新增治愈人数
          curedIncr:data.curedIncr,
        // 累计确诊
          confirmedCount:data.confirmedCount,
        // 相比昨日累计确诊人数
           confirmedIncr:data.confirmedIncr,
        // 现存无症状人数
          seriousCount:data.seriousCount,
        // 相比于昨日无症状人数
           seriousIncr:data.seriousIncr,
        // 新增境外输入
           suspectedIncr:data.suspectedIncr,
        // 累计境外输入
          suspectedCount:data.suspectedCount,
          // 时间
          modifyTime:data.modifyTime
      }
      // console.log(this.covNum);

      })
    }
  },
  created() {
    this.getCovData();
  },

};
</script>

<style  scoped>
*{
  margin:0;
  padding:0;
}
.banner>img{
  width: 100%;
  height: 40vh;
}
.banner{
  width: 100%;
  height: 40vh;
}
#covSize{
  margin: 0 auto;
  margin-top:-25vh;
  width: 350px;
  height: 20px;
  font-size: 40px;
  font-weight: 600;
  color: white;
}
.list{
  display: flex;
  border-top: 2px solid rgba(43, 42, 42,0.1);
  padding-top: 6px;
  margin-bottom:8px;
}
.item{
  flex:1;
  text-align: center;
  list-style: none;
  color: #666;
}
#foot{
  width: 100%;
  height: 130px;
  background: #444;
}
</style>
